home *** CD-ROM | disk | FTP | other *** search
- function do_sound(snd, flag)
- {
- boomSound.attachSound(snd);
- boomSound.start();
- }
- function bullet_rem()
- {
- bullet._x = 100000;
- }
- function bob(x, y)
- {
- _root.boom_dp = _root.boom_dp + 1;
- if(boom_db >= 300)
- {
- boom_db = 200;
- }
- nm = "bob" + boom_dp;
- _root.tohit.push(nm);
- do
- {
- vx = random(20) - 10;
- vy = random(20) - 10;
- }
- while(vx <= 2 && vx >= -2 && vy <= 2 && vy >= -2);
-
- _root.attachMovie("bob_obj",nm,boom_dp,{vectorX:vx,vectorY:vy});
- _root[nm]._x = x + _root.half_heart;
- _root[nm]._y = y + _root.half_heart + 5;
- _root[nm].cacheAsBitmap();
- _root[nm].active = true;
- _root.torem_objects.push(nm);
- }
- function bobo(x, y)
- {
- _root.boom_dp = _root.boom_dp + 1;
- if(boom_db >= 300)
- {
- boom_db = 200;
- }
- nm = "bobo" + boom_dp;
- _root.tohit.push(nm);
- _root.attachMovie("bobo_obj",nm,boom_dp);
- _root[nm]._x = x + _root.half_heart;
- _root[nm]._y = y + _root.half_heart + 5;
- _root[nm].cacheAsBitmap();
- _root[nm].active = true;
- _root.torem_objects.push(nm);
- }
- function spark(x1, y1, x2, y2)
- {
- _root.boom_dp = _root.boom_dp + 1;
- if(boom_db >= 300)
- {
- boom_db = 200;
- }
- nm = "spark_" + boom_dp;
- _root.attachMovie("spark_obj",nm,boom_dp);
- _root.torem_objects.push(nm);
- dx = x1 - x2;
- dy = y1 - y2;
- path = Math.sqrt(dx * dx + dy * dy);
- di = 12;
- dj = 3;
- path_part = path / di;
- _root[nm].draw_obj.moveTo(x1,y1);
- j = 0;
- while(j < dj)
- {
- i = 1;
- while(i <= di)
- {
- delta_x = x1 - x2;
- delta_y = y1 - y2;
- a = (- Math.atan2(delta_x,delta_y)) / 0.017453292519943295;
- if(i + 1 < di)
- {
- a += -2 + random(4);
- }
- _root[nm].draw_obj.lineStyle(1,39423,100,true,"none","round","miter",1);
- _root[nm].draw_obj.lineTo(x1 + path_part * i * Math.sin(a * 0.017453292519943295),y1 - path_part * i * Math.cos(a * 0.017453292519943295));
- i++;
- }
- j++;
- }
- }
- function boom(x, y, clr, size)
- {
- _root.boom_dp = _root.boom_dp + 1;
- if(boom_db >= 300)
- {
- boom_db = 200;
- }
- nm = "boom" + boom_dp;
- _root.torem_objects.push(nm);
- _root.attachMovie("boom_obj",nm,boom_dp);
- _root[nm]._x = x + _root.half_heart;
- _root[nm]._y = y + _root.half_heart;
- if(size != undefined)
- {
- _root[nm]._width = size;
- _root[nm]._height = size;
- }
- _root[nm].boom_ani.gotoAndStop(clr);
- _root[nm].cacheAsBitmap();
- }
- function try_end()
- {
- if(_root.tohit.length <= 0)
- {
- if(level_arrows <= 0)
- {
- if(hearts_beat >= hearts_req)
- {
- win();
- return true;
- }
- if(hearts_beat <= hearts_req)
- {
- lose();
- return true;
- }
- }
- if(hearts_beat >= _root.level_objects.length)
- {
- win();
- return true;
- }
- }
- return false;
- }
- function show_blur()
- {
- myBitmapData.draw(_root);
- var _loc5_ = 5;
- var _loc4_ = 5;
- var _loc2_ = 3;
- var _loc3_ = new flash.filters.BlurFilter(_loc5_,_loc4_,_loc2_);
- myBitmapData.applyFilter(myBitmapData,myBitmapData.rectangle,new flash.geom.Point(0,0),_loc3_);
- blur_mc._visible = true;
- bmp.jpg.attachBitmap(myBitmapData,2,"auto",true);
- bmp.gotoAndPlay(2);
- }
- function win()
- {
- resss.enabled = false;
- show_blur();
- cupedon.stop();
- _root.score_menu._visible = true;
- _root.score_menu.score_menu.gotoAndStop(1);
- _root.score_menu.score_menu.score = level_score;
- _root.score_menu.score_menu.compl.text = "Level " + _root.level + " Completed";
- _root.total_score += level_score;
- _root.score_menu.play();
- gameplay = false;
- paused = true;
- }
- function lose()
- {
- show_blur();
- cupedon.stop();
- _root.score_menu._visible = true;
- _root.score_menu.score_menu.gotoAndStop(2);
- _root.score_menu.score_menu.hearts = hearts_req - hearts_beat;
- _root.score_menu.play();
- gameplay = false;
- paused = true;
- }
- function oef()
- {
- if(_root._fps < 55)
- {
- back._x -= 0.5;
- if(back._x <= -920)
- {
- back._x = 0;
- }
- }
- var _loc2_ = {x:cupedon.kupedon.hand._x,y:cupedon.kupedon.hand._y};
- cupedon.kupedon.hand.localToGlobal(_loc2_);
- if(!paused)
- {
- board.level = _root.level;
- board.arrows = total_arrows;
- board.score = total_score + level_score;
- board.hearts = hearts_beat + "/" + hearts_req;
- if(bullet._x <= -50 or bullet._x >= 750 or bullet._y >= 550)
- {
- if(!try_end() && !gameplay)
- {
- bullet._x = 400000;
- bow_str._visible = true;
- bow.gotoAndStop(1);
- gameplay = true;
- i = 0;
- while(i < todel_objects.length)
- {
- stage_objects.splice(todel_objects[i],1);
- i++;
- }
- }
- }
- }
- if(!paused)
- {
- delta_x = bow._x - _xmouse;
- delta_y = bow._y - _ymouse;
- a = (- Math.atan2(delta_x,delta_y)) / 0.017453292519943295;
- if(a < 0 && a > -180)
- {
- cupedon._xscale = 100;
- bow._xscale = 100;
- bow_hand._xscale = 100;
- bow_hand2._xscale = 100;
- bow_legs._xscale = 100;
- bow_air._xscale = 100;
- bow_str._xscale = 100;
- bow._x = _loc2_.x + 5;
- bow_air._x = bow._x + 6;
- }
- else
- {
- bow._x = _loc2_.x - 5;
- bow_air._x = bow._x - 6;
- cupedon._xscale = -100;
- bow._xscale = -100;
- bow_hand._xscale = -100;
- bow_hand2._xscale = -100;
- bow_legs._xscale = -100;
- bow_air._xscale = -100;
- bow_str._xscale = -100;
- }
- bow._rotation = a;
- bow_hand._rotation = a;
- bow._y = _loc2_.y + 23;
- bow_air._y = bow._y + 14;
- bow_hand._x = bow._x;
- bow_hand._y = bow._y;
- bow_legs._x = bow._x;
- bow_legs._y = bow._y + 18;
- delta_x = bow_str._x - _xmouse;
- delta_y = bow_str._y - _ymouse;
- a = (- Math.atan2(delta_x,delta_y)) / 0.017453292519943295;
- bow_str._rotation = a;
- bow_str._x = bow._x - (power - 15) / 2 * Math.sin(bow_str._rotation * 0.017453292519943295);
- bow_str._y = bow._y + (power - 15) / 2 * Math.cos(bow_str._rotation * 0.017453292519943295);
- bow_hand2._x = bow_str._x;
- bow_hand2._y = bow_str._y;
- if(a < 0 && a > -180)
- {
- delta_x = bow_hand2._x - bow._x + 20;
- delta_y = bow_hand2._y - bow._y;
- a = (- Math.atan2(delta_x,delta_y)) / 0.017453292519943295;
- bow_hand2._rotation = - a;
- }
- else
- {
- delta_x = bow_hand2._x - bow._x - 20;
- delta_y = bow_hand2._y - bow._y;
- a = (- Math.atan2(delta_x,delta_y)) / 0.017453292519943295;
- bow_hand2._rotation = - a;
- }
- }
- }
- function power_on()
- {
- if(power_t == "up")
- {
- power += 2.5;
- }
- if(power_t == "down")
- {
- power -= 2.5;
- }
- if(power >= 50)
- {
- power_t = "down";
- }
- if(power < 15)
- {
- power_t = "up";
- }
- }
- stop();
- _root.wl = "empty";
- if(_root.gamemode == "normal")
- {
- hearts_req = 60;
- total_arrows = 3;
- }
- else if(_root.gamemode == "hardcore")
- {
- hearts_req = 60;
- total_arrows = 1;
- }
- var colors_array = new Array("red","violet","blue","pink");
- delete onEnterFrame;
- delete mouseListener;
- clearInterval(oef_int);
- clearInterval(power_on_int);
- _root.createEmptyMovieClip("draw_mc",413);
- oef_int = setInterval(oef,42);
- _root._fps = 55;
- hearts_beat = 0;
- board.level = _root.level;
- board.arrows = total_arrows;
- board.score = total_score;
- board.hearts = hearts_beat + "/" + hearts_req;
- power_t = "up";
- power = 15;
- gameplay = true;
- gravity = 2;
- xgravity = 0;
- stoned = false;
- _root.boom_dp = 200;
- bullet._x = 100000;
- level_score = 0;
- paused = false;
- level_arrows = total_arrows;
- var tohit = new Array();
- var mouseListener = new Object();
- var boomSound = new Sound();
- _root.createEmptyMovieClip("blur_mc",400);
- i = 1;
- while(i <= 14)
- {
- if(i > total_arrows)
- {
- board_arrows["a" + i]._visible = false;
- }
- i++;
- }
- resss.enabled = true;
- savings.data.score = _root.total_score;
- savings.data.level = _root.level;
- savings.data.gamemode = _root.gamemode;
- var myBitmapData = new flash.display.BitmapData(700,500,true,13421772);
- onEnterFrame = function()
- {
- mseconds = getTimer() - timeStart;
- draw_mc.moveTo(bullet._x,bullet._y);
- bullet._x += bullet.vector.x;
- bullet._y -= bullet.vector.y;
- bullet.vector.x *= 0.9800000000000004;
- bullet.vector.y *= 0.9800000000000004;
- bullet.vector.y -= gravity;
- bullet.vector.x -= xgravity;
- if(gravity != 0)
- {
- bullet._rotation = Math.atan2(bullet.vector.x,bullet.vector.y) / 0.017453292519943295;
- }
- timeStart = getTimer();
- _root._fps = mseconds;
- };
- mouseListener.onMouseDown = function()
- {
- if(_root.tohit.length <= 0)
- {
- clearInterval(power_on_int);
- if(gameplay)
- {
- power = 15.1;
- power_on_int = setInterval(power_on,42);
- }
- }
- };
- mouseListener.onMouseUp = function()
- {
- if(gameplay && power > 15)
- {
- _root.gravity = 2;
- board_arrows["a" + level_arrows]._visible = false;
- level_arrows--;
- gameplay = false;
- clearInterval(power_on_int);
- bow_str._visible = false;
- bow.gotoAndPlay(2);
- bullet._x = bow._x + 40 * Math.sin(bow._rotation * 0.017453292519943295);
- bullet._y = bow._y - 40 * Math.cos(bow._rotation * 0.017453292519943295);
- bullet.vector = {x:power * Math.sin(bow._rotation * 0.017453292519943295),y:power * Math.cos(bow._rotation * 0.017453292519943295)};
- power = 15;
- }
- };
- Mouse.addListener(mouseListener);
-